package string;

public class SubstringDemo {
    public static void main(String[] args) {
        //            01234567890
        String str = "www.tedu.cn";
        String sub = str.substring(4, 8);
        System.out.println(sub);
        //只传入其实位置，从该位置截取到字符串末尾
        sub = str.substring(4);
        System.out.println(sub);
    }
}
